package vy.org.app.page.lookup.religion;

import org.vy.dal.dao.lookup.VyLookupReligionDO;

import vy.org.util.DateUtil;

public class MntnReligionAssembler {

	private static MntnReligionAssembler assembler = new MntnReligionAssembler();

	public static MntnReligionAssembler getAssembler() {
		return assembler;
	}

	public VyLookupReligionDO getLookupReligionDO(MntnReligionForm form) {
		VyLookupReligionDO dto = new VyLookupReligionDO();

		if (form.getReligionCode() != null
				&& !"".equals(form.getReligionCode().trim())) {

			dto.setReligionCode(form.getReligionCode());
		}
		if (form.getReligionName() != null
				&& !"".equals(form.getReligionName().trim())) {

			dto.setReligionName(form.getReligionName());
		}
		if (form.getIsActive() != null && !"".equals(form.getIsActive().trim())) {

			dto.setIsActive(Boolean.parseBoolean(form.getIsActive()));
		}
		if (form.getLastUpdatedBy() != null
				&& !"".equals(form.getLastUpdatedBy().trim())) {

			dto.setLastUpdatedBy(form.getLastUpdatedBy());
		}
		if (form.getLastUpdatedOn() != null
				&& !"".equals(form.getLastUpdatedOn().trim())) {

			dto.setLastUpdtOn(DateUtil.standardDate(form.getLastUpdatedOn()));
		}

		return dto;
	}

}
